package test;

import entity.Student;

import java.lang.reflect.Constructor;

/**
 * @author zhu
 * @date 2024-03-26
 */
public class MainTest01 {
    public static void main(String[] args) throws Exception {
        Class<Student> clazz = Student.class;

        Constructor<Student> constructor = clazz.getConstructor(String.class,int.class,Double.class);

        Object obj = constructor.newInstance("zs",18,50.0);
        if (obj instanceof Student ){
            Student stu = (Student) obj;
            stu.show(stu);
        }
    }
}
